{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## EX1\n",
    "\n",
    "At the beginning of the new semester, the ages of all students need to be updated, and the ages of all students should be increased by one year.\n",
    "\n",
    "```\n",
    "student_list=[\n",
    "    {'name':'May', 'age':'12', 'class':'201', 'gen':'男'},\n",
    "    {'name':'Louis', 'age':'12', 'class':'202', 'gen':'女'},\n",
    "    {'name':'Jay', 'age':'14', 'class':'202', 'gen':'女'},\n",
    "    {'name':'Mark', 'age':'13', 'class':'201', 'gen':'男'},\n",
    "]\n",
    "```"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "12\n",
      "[{'name': 'May', 'age': 13, 'class': '201', 'gen': '男'}, {'name': 'Louis', 'age': '12', 'class': '202', 'gen': '女'}, {'name': 'Jay', 'age': '14', 'class': '202', 'gen': '女'}, {'name': 'Mark', 'age': '13', 'class': '201', 'gen': '男'}]\n",
      "12\n",
      "[{'name': 'May', 'age': 13, 'class': '201', 'gen': '男'}, {'name': 'Louis', 'age': 13, 'class': '202', 'gen': '女'}, {'name': 'Jay', 'age': '14', 'class': '202', 'gen': '女'}, {'name': 'Mark', 'age': '13', 'class': '201', 'gen': '男'}]\n",
      "14\n",
      "[{'name': 'May', 'age': 13, 'class': '201', 'gen': '男'}, {'name': 'Louis', 'age': 13, 'class': '202', 'gen': '女'}, {'name': 'Jay', 'age': 15, 'class': '202', 'gen': '女'}, {'name': 'Mark', 'age': '13', 'class': '201', 'gen': '男'}]\n",
      "13\n",
      "[{'name': 'May', 'age': 13, 'class': '201', 'gen': '男'}, {'name': 'Louis', 'age': 13, 'class': '202', 'gen': '女'}, {'name': 'Jay', 'age': 15, 'class': '202', 'gen': '女'}, {'name': 'Mark', 'age': 14, 'class': '201', 'gen': '男'}]\n"
     ]
    }
   ],
   "source": [
    "student_list=[\n",
    "    {'name':'May', 'age':'12', 'class':'201', 'gen':'男'},\n",
    "    {'name':'Louis', 'age':'12', 'class':'202', 'gen':'女'},\n",
    "    {'name':'Jay', 'age':'14', 'class':'202', 'gen':'女'},\n",
    "    {'name':'Mark', 'age':'13', 'class':'201', 'gen':'男'},\n",
    "]\n",
    "\n",
    "\n",
    "for student in student_list:\n",
    "    print(student['age'])\n",
    "    student['age']= int (student['age'])+ 1\n",
    "    print(student_list)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## EX2 \n",
    "\n",
    "Find all the elements that start with `A` or `a` or end with c.\n",
    "```\n",
    "word_list = ['alec','aric','Alex',' Tony','rain', 'Luc']\n",
    "```"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "alec begin letter: a\n"
     ]
    }
   ],
   "source": [
    "# write your code\n",
    "# for example :  alec -> the begin letter is a,  the last letter is c\n",
    "word_list = ['alec','aric','Alex','Tony','rain','Luc']\n",
    "w = word_list[0]\n",
    "print(w, \"begin letter:\", w[0])\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.7"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
